<?php	
	$roomID = $_GET["roomID"];
	
	$con = mysql_connect("localhost","root","");
	if (!$con) {
		die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("ciu196", $con);
	
	$xmlDistrubution = "";
	
	// STOP
	$sql = "SELECT count(*) FROM StudentsInRooms WHERE roomID = '$roomID' AND tempo = 'stop';" ;
	$res = mysql_query($sql,$con);
	$status = mysql_fetch_row($res);
	$xmlDistrubution .= "<stop>$status[0]</stop>";
	
	// HARD
	$sql = "SELECT count(*) FROM StudentsInRooms WHERE roomID = '$roomID' AND tempo = 'hard';" ;
	$res = mysql_query($sql,$con);
	$status = mysql_fetch_row($res);
	$xmlDistrubution .= "<hard>$status[0]</hard>";
	
	// OK
	$sql = "SELECT count(*) FROM StudentsInRooms WHERE roomID = '$roomID' AND tempo = 'ok';" ;
	$res = mysql_query($sql,$con);
	$status = mysql_fetch_row($res);
	$xmlDistrubution .= "<ok>$status[0]</ok>";

	
	// EASY
	$sql = "SELECT count(*) FROM StudentsInRooms WHERE roomID = '$roomID' AND tempo = 'easy';" ;
	$res = mysql_query($sql,$con);
	$status = mysql_fetch_row($res);
	$xmlDistrubution .= "<easy>$status[0]</easy>";
	
	
	/*$xmlDistrubution = "<?xml version='1.0'?> <room>$xmlDistrubution</room>";
	*/
	
	echo $xmlDistrubution;
?>